import { BookOpen, Users, Heart, Star } from 'lucide-react'
import { BookCard } from '@/components/ui'
import { Book } from '@/stores/books'

interface FeaturedBooksProps {
  books: Book[]
  onBookClick?: (book: Book) => void
}

const mockFeaturedBooks: Book[] = [
  {
    id: '1',
    title: '小熊宝宝绘本系列',
    author: '佐佐木洋子',
    cover_image_url: 'https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=cute%20little%20bear%20character%2C%20children%20book%20illustration%2C%20soft%20colors%2C%20warm%20and%20friendly%20style&image_size=portrait_4_3',
    description: '培养宝宝良好生活习惯的经典绘本',
    price: 128,
    rental_price: 15,
    age_range: '0-3岁',
    category: { id: '1', name: '生活习惯', type: 'book' },
    rating: 4.8,
    is_featured: true
  },
  {
    id: '2',
    title: '猜猜我有多爱你',
    author: '山姆·麦克布雷尼',
    cover_image_url: 'https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=rabbit%20characters%2C%20love%20theme%2C%20children%20book%20illustration%2C%20warm%20colors&image_size=portrait_4_3',
    description: '经典亲子情感绘本，表达爱的深度',
    price: 89,
    rental_price: 12,
    age_range: '3-6岁',
    category: { id: '2', name: '情感教育', type: 'book' },
    rating: 4.9,
    is_featured: true
  },
  {
    id: '3',
    title: '好饿的毛毛虫',
    author: '艾瑞·卡尔',
    cover_image_url: 'https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=colorful%20caterpillar%2C%20children%20book%20illustration%2C%20bright%20colors%2C%20educational%20style&image_size=portrait_4_3',
    description: '经典认知绘本，学习数字和食物',
    price: 68,
    rental_price: 10,
    age_range: '2-5岁',
    category: { id: '3', name: '认知启蒙', type: 'book' },
    rating: 4.7,
    is_featured: true
  },
  {
    id: '4',
    title: '我爸爸',
    author: '安东尼·布朗',
    cover_image_url: 'https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=father%20and%20child%20illustration%2C%20warm%20family%20scene%2C%20children%20book%20style&image_size=portrait_4_3',
    description: '温馨父子情感绘本，感受父爱如山',
    price: 75,
    rental_price: 11,
    age_range: '3-6岁',
    category: { id: '2', name: '情感教育', type: 'book' },
    rating: 4.6,
    is_featured: true
  }
]

export function FeaturedBooks({ onBookClick }: FeaturedBooksProps) {
  return (
    <div className="px-4 py-6">
      <div className="flex items-center justify-between mb-4">
        <div className="flex items-center gap-2">
          <Star className="text-huiben-yellow" size={20} />
          <h2 className="text-lg font-bold text-huiben-sky-dark">热门绘本</h2>
        </div>
        <button className="text-sm text-huiben-sky hover:text-huiben-sky-dark transition-colors">
          查看更多 →
        </button>
      </div>
      
      <div className="grid grid-cols-2 gap-4">
        {mockFeaturedBooks.map((book) => (
          <BookCard
            key={book.id}
            title={book.title}
            author={book.author}
            coverUrl={book.cover_image_url}
            price={book.price}
            ageRange={book.age_range}
            rating={book.rating}
            onClick={() => onBookClick?.(book)}
          />
        ))}
      </div>
    </div>
  )
}